#include "powerdev.h"

using rtdev::DefaultRobPower;

DefaultRobPower::DefaultRobPower()
{
    is_cmd_power_on = false;
    feedback_voltage = 0;
    feedback_current = 0;
    feedback_power = 0;
    scb = nullptr;
}
int DefaultRobPower::set_power(bool power, int robid)
{
    if (robid < 0)
        return -1;
    is_cmd_power_on = power;
    return 0;
}
double DefaultRobPower::get_power(int robid)
{
    if (robid < 0)
        return 0;
    if (scb->is_sim())
    {
        return 0;
    }
    return feedback_power;
}
double DefaultRobPower::get_voltage(int robid)
{
    if (robid < 0)
        return 0;
    if (scb->is_sim())
    {
        return 0;
    }
    return feedback_voltage;
}
double DefaultRobPower::get_current(int robid)
{
    if (robid < 0)
        return 0;
    if (scb->is_sim())
    {
        return 0;
    }
    return feedback_current;
}